﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ItemBLL it = new ItemBLL();
        CollectionPager1.PageSize = 8; // số items hiển thị trên một trang
        CollectionPager1.MaxPages = 10000;
        if (Request.QueryString["name"] == "")
        {
            CollectionPager1.DataSource = it.getAllItemCat();
        }
        else
        {
            CollectionPager1.DataSource = it.getSearch(Request.QueryString["name"]);
        }
        CollectionPager1.BindToControl = SearchResult;
        SearchResult.DataSource = CollectionPager1.DataSourcePaged;
        SearchResult.DataBind();
    }
}